<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增生产工单')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-workorder-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">工单号：</label>
                <div class="col-sm-8">
                    <input name="workOrder" id="workOrder" readonly class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">创建人：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="createPerson" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">计划产能：</label>
                <div class="col-sm-8">
                    <input name="planQty" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实际产能：</label>
                <div class="col-sm-8">
                    <input name="realQty" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group" hidden="hidden">-->
<!--                <label class="col-sm-3 control-label">负责人id：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="principalId" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">负责人账号：</label>
                <div class="col-sm-8">
<!--                    <input name="principalName" class="form-control" type="text">-->
                    <select id="principalName" name="principalName" class="form-control">
                        <option th:each="user : ${user}" th:text="${user['loginName']}" th:value="${user['userId']}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script src="../../../static/ruoyi/js/personSelf.js" th:src="@{/ruoyi/js/personSelf.js}"></script>
    <script type="text/javascript">
        $(function () {
            var a = createWorkOrder();
            $('#workOrder').val(a);
        });
        var prefix = ctx + "WorkOrder/workorder"
        $("#form-workorder-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var data = $("#form-workorder-add").serializeArray();
                var principalId = $("#principalName option:selected").val();
                data.push({"name": "principalId", "value": principalId});
                $.operate.save(prefix + "/add", data);
            }
        };
    </script>
</body>
</html>